<?php
$sum = $_POST['sum'];
// $sum = 4;

$mysql = new SaeMysql();
$sql = "SELECT DISTINCT `wx_wall_name`, `wx_wall_openid` FROM `wx_wall`";
$data = $mysql->getData($sql);

$rand = array();
$arr = range(0, count($data)-1);
$tmparr = array_rand($arr, $sum);

$i = 0;
foreach($tmparr as $k=>$v){
	$f[$i]['name'] = $data[$v]['wx_wall_name'];
	$f[$i]['openid'] = $data[$v]['wx_wall_openid'];
	$i++;
}

$xyclient = json_encode($f);
echo $xyclient;
?>